<#assign uiElements = []>

<#--  Creats CATDlg DataType and variable name hashTable
 * Adds Default Lable for Editor, Combo, CkeParamEditor, Spinner
 * For single element list add a label for other ListTypes - n-List/BiList/MultiList
 * @param attribs
 *  HashTable as given in tdd file
-->
<#macro UI_ELEMENTS_DATA_TYPES attribs >
<#assign row =  -1  >
<#list attribs as attr>
<#if  (attr.UI?length > 0 ) >
<#assign row =  row + 1 >
<#switch attr.UI>
<#case "List">
	<#if attr.type == "tk_specobject">
	<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"LabelMonoList","id":"Label${attr.name}","name":"Label${attr.name}", "dlg":"CATDlgLabel", "row":"${row}", "col":"0", "style":"NULL" }] >
	<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"Mono${attr.UI}","id":"${attr.name}", "name":"Frame${attr.name}", "dlg":"CATDlgFrame", "row":"${row}", "col":"1", "style":"CATDlgGridLayout | CATDlgFraNoFrame" }] >
	<#break>
	</#if>
<#case "BiList">
<#case "PolyList">
<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"${attr.UI}","id":"${attr.name}", "name":"Frame${attr.name}", "dlg":"CATDlgFrame", "row":"${row}", "col":"0", "style":"CATDlgGridLayout" }] >
<#break>
<#case "Param">
<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"${attr.UI}","id":"Label${attr.name}","name":"Label${attr.UI}Editor${attr.name}", "dlg":"CATDlgLabel", "row":"${row}", "col":"0", "style":"NULL" }] >
<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"${attr.UI}","id":"${attr.name}","name":"${attr.UI}Editor${attr.name}", "dlg":"CATDialog", "row":"${row}", "col":"1", "style":"" }] >
<#break>
<#case "Spinner">
<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"${attr.UI}","id":"Label${attr.name}","name":"Label${attr.UI}${attr.name}", "dlg":"CATDlgLabel", "row":"${row}", "col":"0", "style":"NULL" }] >
<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"${attr.UI}","id":"${attr.name}","name":"${attr.UI}${attr.name}", "dlg":"CATDlgSpinner", "row":"${row}", "col":"1", "style":"NULL" }] >
<#break>
<#case "Combo">
<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"${attr.UI}", "id":"Label${attr.name}","name":"Label${attr.UI}${attr.name}", "dlg":"CATDlgLabel"  , "row":"${row}", "col":"0", "style":"NULL" }] >
<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"${attr.UI}", "id":"${attr.name}",       "name":"${attr.UI}${attr.name}"		, "dlg":"CATDlgCombo", "row":"${row}", "col":"1", "style":"CATDlgCmbDropDown|CATDlgCmbEntry" }] >
<#break>
<#case "Editor">
<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"${attr.UI}", "id":"Label${attr.name}","name":"Label${attr.UI}${attr.name}", "dlg":"CATDlgLabel"  , "row":"${row}", "col":"0", "style":"NULL" }] >
<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"${attr.UI}", "id":"${attr.name}","name":"${attr.UI}${attr.name}"		, "dlg":"CATDlgEditor", "row":"${row}", "col":"1", "style":"NULL" }] >
<#break>
<#default >
<#assign uiElements = uiElements + [ {"Title":"${attr.name}","UI":"${attr.UI}", "id":"${attr.name}","name":"${attr.UI}${attr.name}", "dlg":"CATDlg${attr.UI}" , "row":"${row}", "col":"0", "style":"NULL"}] >
<#break>
</#switch>
</#if>
</#list>
</#macro>

<#--  Declare variables in Dialog.h file. Call UI_ELEMENTS_DATA_TYPES EXACTLY once before calling this
 * @param attribs
 *  List of HashTable : global variable uiElements
-->
<#macro DECLARE_UI_VARS  uiDataTypes>
<#list uiDataTypes as uiElem>
${uiElem.dlg} 				*  _${uiElem.name} ;
</#list>
</#macro>

<#--  Assign variables to NULL in constructor and destructor. Call UI_ELEMENTS_DATA_TYPES EXACTLY once before calling this
 * @param attribs
 *  List of HashTable : global variable uiElements
-->
<#macro ASSIGN_UI_VARS_NULL  uiDataTypes>
<#list uiDataTypes as uiElem>
_${uiElem.name} = NULL ;
</#list>
</#macro>

<#assign states =  []  >
<#--  Lists the number of states required.
 * @param attribs
 *  List of HashTable elements: global variable Attributes read from tdd file.
-->
<#macro CALC_STATES  attribs>
<#list attribs as attr>
<#switch attr.UI >
<#case "PolyList">
<#case "List">
<#assign states = states + [ {"name":"${attr.name}", "state":"p${attr.name}State", "agent":"_pFeatureAgent${attr.name}",  "dlgAgent":"_pDlgAgent${attr.name}", "IID":"${attr.IID}"  }] >
<#break>
</#switch>
</#list>
</#macro>

